package com.hei.service;

import com.hei.dao.BkindMapper;
import com.hei.pojo.Bkind;
import com.hei.pojo.Blabel;
import com.hei.util.uuid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class BkindServiceImpl implements BkindService {
    @Autowired
    private BkindMapper bkindMapper;
    public List<Bkind> selectAllKind(Map<String,Object> map) {
        return bkindMapper.selectAllKind(map);
    }

    @Override
    public void addKind(Bkind kind) {
        kind.setId(uuid.getUUId());
        kind.setPublish(1);
        bkindMapper.insert(kind);
    }

    @Override
    public void deleteKind(String id) {
        Bkind bkind=new Bkind();
        bkind.setId(id);
        bkind.setPublish(0);
        bkindMapper.updateByPrimaryKeySelective(bkind);
    }

    @Override
    public List<Bkind> queryAllKind(Map<String, Object> map) {
        return bkindMapper.queryAllKind(map);
    }

    @Override
    public List<Bkind> queryUsedKind() {
        return bkindMapper.queryUsedKind();
    }

    @Override
    public String selectFirstId() {
        return bkindMapper.selectFirstId();
    }


}
